Skip to content

Conversation

@18202781743
Copy link
Contributor

@18202781743 18202781743 commented Sep 23, 2025

The close button in notifications was difficult to click because the
hover detection area was too small. Changed the FocusScope to a Control
component with hover tracking capability. Added hover state as a trigger
condition for displaying the close button, making it easier for users to
close notifications by expanding the interactive area.

Log: Improved notification close button interaction by expanding hover
detection area

Influence:

  1. Test hovering over notification area to verify close button appears
  2. Verify close button functionality works correctly when clicked
  3. Test with notifications containing actions to ensure
    strongInteractive mode still works
  4. Check close button visibility in different notification states
  5. Verify accessibility and keyboard navigation still functions properly

fix: 改进通知关闭按钮悬停检测

通知中的关闭按钮难以点击,因为悬停检测区域太小。将 FocusScope 改为具有悬
停跟踪功能的 Control 组件。添加悬停状态作为显示关闭按钮的触发条件,通过
扩大交互区域使用户更容易关闭通知。

Log: 通过扩大悬停检测区域改进了通知关闭按钮的交互体验

Influence:

  1. 测试悬停在通知区域时关闭按钮是否正常显示
  2. 验证点击关闭按钮功能是否正常工作
  3. 测试包含操作的通知,确保强交互模式仍然有效
  4. 检查不同通知状态下关闭按钮的可见性
  5. 验证辅助功能和键盘导航是否仍然正常工作

Summary by Sourcery

Improve hover detection area for notification close button by replacing FocusScope with Control and updating visibility logic to show the button on hover.

Bug Fixes:

  • Fix close button being difficult to click by expanding its hover detection area

Enhancements:

  • Replace FocusScope with Control component to enable hover tracking
  • Include hover state as a trigger for displaying the close button

The close button in notifications was difficult to click because the
hover detection area was too small. Changed the FocusScope to a Control
component with hover tracking capability. Added hover state as a trigger
condition for displaying the close button, making it easier for users to
close notifications by expanding the interactive area.

Log: Improved notification close button interaction by expanding hover
detection area

Influence:
1. Test hovering over notification area to verify close button appears
2. Verify close button functionality works correctly when clicked
3. Test with notifications containing actions to ensure
strongInteractive mode still works
4. Check close button visibility in different notification states
5. Verify accessibility and keyboard navigation still functions properly

fix: 改进通知关闭按钮悬停检测

通知中的关闭按钮难以点击,因为悬停检测区域太小。将 FocusScope 改为具有悬
停跟踪功能的 Control 组件。添加悬停状态作为显示关闭按钮的触发条件,通过
扩大交互区域使用户更容易关闭通知。

Log: 通过扩大悬停检测区域改进了通知关闭按钮的交互体验

Influence:
1. 测试悬停在通知区域时关闭按钮是否正常显示
2. 验证点击关闭按钮功能是否正常工作
3. 测试包含操作的通知,确保强交互模式仍然有效
4. 检查不同通知状态下关闭按钮的可见性
5. 验证辅助功能和键盘导航是否仍然正常工作
@sourcery-ai
Copy link

sourcery-ai bot commented Sep 23, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Enhanced notification close button interaction by expanding the hoverable area and switching to a hover-aware placeholder component, ensuring the close button appears more reliably when hovered.

Class diagram for updated NotifyItemContent structure

classDiagram
    class NotifyItem {
        bool closeVisible
        int miniContentHeight
        bool enableDismissed
    }
    class Control {
        bool hovered
    }
    class SettingActionButton {
        string objectName
    }
    NotifyItem o-- Control : uses
    Control o-- SettingActionButton : loads
    NotifyItem o-- SettingActionButton : closeBtn
    NotifyItem : closeVisible = activeFocus || impl.hovered
    Control : hovered
    SettingActionButton : objectName = "closeNotify-" + root.appName
Loading

File-Level Changes

Change Details Files
Expanded hover detection to trigger close button visibility
  • Updated closeVisible property to include impl.hovered
  • Adjusted Loader active condition to consider closePlaceHolder.hovered
panels/notification/plugin/NotifyItemContent.qml
Replaced FocusScope with Control to track hover state
  • Swapped FocusScope for Control component with id closePlaceHolder
  • Configured Control as the placeholder for mouse events to enable hover tracking
panels/notification/plugin/NotifyItemContent.qml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes - here's some feedback:

  • Enable hoverEnabled: true on the new Control placeholder so that closePlaceHolder.hovered actually receives hover events.
  • Simplify the Loader’s active binding by removing the redundant activeFocus check since closeVisible already includes focus state.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Enable hoverEnabled: true on the new Control placeholder so that closePlaceHolder.hovered actually receives hover events.
- Simplify the Loader’s active binding by removing the redundant activeFocus check since closeVisible already includes focus state.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, BLumia, mhduiy, robertkill

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

2 similar comments
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, BLumia, mhduiy, robertkill

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, BLumia, mhduiy, robertkill

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot
Copy link

deepin pr auto review

这段代码是一个QML文件,用于通知面板中的通知项内容。我来分析一下代码的改进:

语法逻辑

  1. 修改了closeVisible属性的判断条件,从activeFocus改为activeFocus || impl.hovered,这样当鼠标悬停时也会显示关闭按钮,提高了用户体验。
  2. FocusScope替换为Control,并添加了id: closePlaceHolder,这样可以更好地控制鼠标事件。
  3. 修改了Loaderactive条件,增加了closePlaceHolder.hovered的判断,使得当鼠标悬停在关闭按钮占位区域时也能激活关闭按钮。

代码质量

  1. 使用Control代替FocusScope是一个好的改进,因为Control提供了更多的功能和更好的事件处理能力。
  2. 通过添加closePlaceHolder,代码结构更加清晰,便于维护和理解。
  3. 条件判断的改进使得UI交互更加直观和友好。

代码性能

  1. 这些改动不会对性能产生负面影响,反而可能通过更精确的事件处理提高性能。
  2. 没有引入不必要的组件或复杂的逻辑,保持了代码的简洁性。

代码安全

  1. 改进后的代码没有引入新的安全风险。
  2. 事件处理更加精确,减少了意外触发的情况。

总体评价

这些改进主要是为了提高用户体验和代码质量,通过更合理的条件判断和组件选择,使得通知项的交互更加直观和友好。代码结构也更加清晰,便于后续的维护和扩展。建议继续保持这种良好的代码风格,并在后续开发中继续关注用户体验和代码质量。

@18202781743 18202781743 merged commit cbfd53e into linuxdeepin:master Sep 23, 2025
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants